﻿Option Strict On
Option Infer On
Option Explicit On

Imports System
Imports System.Xml.Linq
Imports System.Collections.Generic
Imports GenDotNet.StoredProcModel
Imports <xmlns:orm="http://kadgen.com/KADORM.xsd">

Public Class TableData
   Inherits BaseData
   Implements ITableData

   Private mSchema As String
   Private mTableName As String

   'Public Shared Function Load(ByVal rootdata As RootData, ByVal elements As IEnumerable(Of XElement)) _
   '       As IEnumerable(Of ITableData)
   '   Dim list = New List(Of ITableData)
   '   For Each e In elements
   '      list.Add(New TableData(rootdata, e))
   '   Next
   '   Return list
   'End Function

   'Public Shared Function Load(ByVal rootdata As RootData, ByVal element As XElement) _
   '       As IEnumerable(Of ITableData)
   '   Dim list = New List(Of ITableData)
   '   list.Add(New TableData(RootData, element))
   '   Return list
   'End Function

   'Private Sub New( _
   '        ByVal rootdata As RootData, _
   '        ByVal element As XElement)
   '   MyBase.New(rootdata, element)
   '   rootdata.AddNewTable(Me)
   'End Sub

   Friend Sub New(ByVal rootdata As RootData, ByVal schema As String, ByVal tableName As String)
      MyBase.New(rootdata, Nothing)
      Me.mSchema = schema
      Me.mTableName = tableName
   End Sub

   Public ReadOnly Property Name() _
            As String _
            Implements ITableData.Name
      Get
         Return mTableName
      End Get
   End Property

   Public ReadOnly Property Schema() _
            As String _
            Implements ITableData.Schema
      Get
         Return mSchema
      End Get
   End Property

End Class
